<template>
  <div class="search-singer">
    <div class="left">
      <img :src="searchSinger.coverImgUrl" />
      <div class="name">歌单： {{ searchSinger.name }}</div>
    </div>
    <img class="right" src="@/assets/right.png" />
  </div>
</template>

<script>
export default {
  props: {
    keywords: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      searchSinger: {},
    };
  },
  created() {
    this.getSinger();
  },
  methods: {
    async getSinger() {
      await this.axios
        .get(`/cloudsearch?keywords=${this.keywords}&type=1000`)
        .then((re) => {
          console.log("专辑==>", re);
          this.searchSinger = re.result.playlists[0];
        });
      this.axios
        .get(`/search/multimatch?keywords=${this.keywords}`)
        .then((i) => {
          console.log("多重匹配==>", i);
        });
    },
  },
};
</script>

<style lang="scss" scoped>
.search-singer {
  width: 100%;
  height: 66px;
  display: flex;
  align-items: center;
  padding: 8px 10px 8px 0;
  margin-left: 10px;
  .left {
    flex: 1;
    display: flex;
    img {
      width: 50px;
      height: 50px;
      margin-right: 15px;
    }
    .name {
      font-size: 17px;
      line-height: 30px;
      color: #333;
    }
  }
  .right {
    width: 10px;
    height: 15px;
    margin: 0 8px 0 10px;
  }
}
</style>